<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>超市后台管理系统-分部</title>
    <!-- Bootstrap Styles-->
    <link href="/static/sm_assets/css/bootstrap.css" rel="stylesheet" />
    <!-- FontAwesome Styles-->
    <link href="/static/sm_assets/css/font-awesome.css" rel="stylesheet" />
    <!-- Morris Chart Styles-->
    <link href="/static/sm_assets/js/morris/morris-0.4.3.min.css" rel="stylesheet" />
    <!-- Custom Styles-->
    <link href="/static/sm_assets/css/custom-styles.css" rel="stylesheet" />
    <!-- Google Fonts-->
    <link href='http://fonts.useso.com/css?family=Open+Sans' rel='stylesheet' type='text/css' />
</head>

<body>
    <div id="wrapper">
        <nav class="navbar navbar-default top-navbar" role="navigation">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".sidebar-collapse">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <a class="navbar-brand public-header" href="/sm_system/">超市后台管理系统-分部</a>
            </div>

            <ul class="nav navbar-top-links navbar-right">
                <li class="dropdown">
                    <a class="dropdown-toggle" data-toggle="dropdown" href="#" aria-expanded="false">
                        <i class="fa fa-user fa-fw"></i> <i class="fa fa-caret-down"></i>
                    </a>
                    <ul class="dropdown-menu dropdown-user">
                        <li class="divider"></li>
                        <li><a href="login.html"><i class="fa fa-sign-out fa-fw"></i> Logout</a>
                        </li>
                    </ul>
                    <!-- /.dropdown-user -->
                </li>
                <!-- /.dropdown -->
            </ul>
        </nav>
        <!--/. NAV TOP  -->
        <nav class="navbar-default navbar-side" role="navigation">
            <div class="sidebar-collapse">
                <!-- <ul class="nav" id="main-menu">
                    <li>
                        <a href="commodity.html"><i class="fa fa-sitemap"></i>商品管理</a>
                    </li>
                    <li>
                        <a href="provider.html"><i class="fa fa-bar-chart-o"></i> 供应商管理</a>
                    </li>
                    <li>
                        <a href="contract.html"><i class="fa fa-qrcode"></i> 合同管理</a>
                    </li>
                    
                    <li>
                        <a href="sale.html"><i class="fa fa-table"></i> 销售信息</a>
                    </li>
                    <li>
                        <a href="customer.html"><i class="fa fa-sitemap"></i> 会员管理</a></i> 会员管理</a>
                    </li>

                    <li>
                        <a href="staff.html"><i class="fa fa-fw fa-file"></i> 职员信息</a>
                    </li>
                </ul>
 -->
            </div>
        </nav>
        <!-- /. NAV SIDE  -->
                
        <div id="page-wrapper">
            <div id="page-inner">


                <div class="row">
                    <div class="col-md-12">
                        <h1 class="page-header">
                            商品信息 <small>商品信息添加页</small>
                        </h1>
                    </div>
                </div>
                <!-- /. ROW  -->

                 <div class="row">
                <div class="col-lg-12">
                    <div class="panel panel-default">
                        <div class="panel-heading">
                            Commodity Information Add
                        </div>
                        <div class="panel-body">
                            <div class="row">
                                <div class="col-lg-6">
                                    <form role="form" action="/commodity/add_form/" method="post">
                                        <div class="form-group">
                                            <label>商品编号</label>
                                            <input id="only_id" class="form-control"  required="required"  name="id" readonly="readonly">
                                        </div>
                                        <div class="form-group">
                                            <label>名称</label>
                                            <input class="form-control" required="required"  name="name">
                                        </div>
                                        <div class="form-group">
                                            <label>商品进价</label>
                                            <input class="form-control" required="required" name="pur_price" type="number">
                                        </div>
                                        <div class="form-group">
                                            <label>商品售价</label>
                                            <input class="form-control" required="required" name="sell_price" type="number">
                                        </div>
                                        <div class="form-group">
                                            <label>商品品牌编号</label>
                                            <input class="form-control" required="required" name="brand_id">
                                        </div>
                                        <div class="form-group">
                                            <label>商品种类编号</label>
                                            <input class="form-control" required="required" name="type_id">
                                        </div>
                                        <button type="submit" class="btn btn-default">提交</button>
                                        <button type="reset" class="btn btn-default">重置</button>
                                    </form>
                                </div>
                            </div>
                            <!-- /.row (nested) -->
                        </div>
                        <!-- /.panel-body -->
                    </div>
                    <!-- /.panel -->
                </div>
                <!-- /.col-lg-12 -->
            </div>


                <!-- /. ROW  -->
                <footer><p>Copyright &copy; 2016.Company name All rights reserved.<a target="_blank" href="http://sc.chinaz.com/moban/">&#x7F51;&#x9875;&#x6A21;&#x677F;</a></p></footer>
            </div>
            <!-- /. PAGE INNER  -->
        </div>
        <!-- /. PAGE WRAPPER  -->
    </div>
    <!-- /. WRAPPER  -->
    <!-- JS Scripts-->
    <!-- jQuery Js -->
    <script src="/static/sm_assets/js/jquery-1.10.2.js"></script>
    <!-- Bootstrap Js -->
    <script src="/static/sm_assets/js/bootstrap.min.js"></script>
    <!-- Metis Menu Js -->
    <script src="/static/sm_assets/js/jquery.metisMenu.js"></script>
    <!-- Morris Chart Js -->
    <script src="/static/sm_assets/js/morris/raphael-2.1.0.min.js"></script>
    <script src="/static/sm_assets/js/morris/morris.js"></script>
    <!-- Custom Js -->
    <script src="/static/sm_assets/js/custom-scripts.js"></script>

    <script type="text/javascript">
        addEventListener("load", function () {
            setTimeout(hideURLbar, 0);
            setTimeout(generate_id,0);
        }, false);

        function hideURLbar() {
            window.scrollTo(0, 1);
        };

        function generate_id(){
             $.ajax({
                 type: "POST",
                 url: "/sm_system/commodity_id/",
                 data: {},
                 dataType: "json",
                 success: function (data) {
                              $("#only_id").val(data.commodity_id);//赋值
                }
                
             });
             return false;
        }
    </script>
</body>

</html>